package com.cyzy.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

/**
 * 购物车表，用于存储用户购物车的信息
 * @TableName shopping_car
 */
@TableName(value ="shopping_car")
public class ShoppingCar implements Serializable {
    /**
     * 购物车ID，主键，自动递增
     */
    @TableId(type = IdType.AUTO)
    private Integer shoppingCarId;

    /**
     * 商品ID，不能为空
     */
    private String goodsId;

    /**
     * 商品名称，不能为空
     */
    private String goodsName;

    /**
     * 商品数量，不能为空
     */
    private String goodsNum;

    /**
     * 用户ID，不能为空
     */
    private String userId;

    /**
     * 商品图片地址
     */
    @TableField(exist = false)
    public  String goodsUrl;

    public String getGoodsPrice() {
        return goodsPrice;
    }

    public void setGoodsPrice(String goodsPrice) {
        this.goodsPrice = goodsPrice;
    }

    /**
     *
     * 商品价格
     */
    @TableField(exist = false)
    public  String goodsPrice;

    public String getGoodsUrl() {
        return goodsUrl;
    }

    public void setGoodsUrl(String goodsUrl) {
        this.goodsUrl = goodsUrl;
    }

    /**
     * 创建时间，默认为当前时间
     */
    private Date createTime;

    /**
     * 更新时间，每次更新时自动更改为当前时间
     */
    private Date updateTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 购物车ID，主键，自动递增
     */
    public Integer getShoppingCarId() {
        return shoppingCarId;
    }

    /**
     * 购物车ID，主键，自动递增
     */
    public void setShoppingCarId(Integer shoppingCarId) {
        this.shoppingCarId = shoppingCarId;
    }

    /**
     * 商品ID，不能为空
     */
    public String getGoodsId() {
        return goodsId;
    }

    /**
     * 商品ID，不能为空
     */
    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId;
    }

    /**
     * 商品名称，不能为空
     */
    public String getGoodsName() {
        return goodsName;
    }

    /**
     * 商品名称，不能为空
     */
    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    /**
     * 商品数量，不能为空
     */
    public String getGoodsNum() {
        return goodsNum;
    }

    /**
     * 商品数量，不能为空
     */
    public void setGoodsNum(String goodsNum) {
        this.goodsNum = goodsNum;
    }

    /**
     * 用户ID，不能为空
     */
    public String getUserId() {
        return userId;
    }

    /**
     * 用户ID，不能为空
     */
    public void setUserId(String userId) {
        this.userId = userId;
    }



    /**
     * 创建时间，默认为当前时间
     */
    public Date getCreateTime() {
        return createTime;
    }

    /**
     * 创建时间，默认为当前时间
     */
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    /**
     * 更新时间，每次更新时自动更改为当前时间
     */
    public Date getUpdateTime() {
        return updateTime;
    }

    /**
     * 更新时间，每次更新时自动更改为当前时间
     */
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ShoppingCar other = (ShoppingCar) that;
        return (this.getShoppingCarId() == null ? other.getShoppingCarId() == null : this.getShoppingCarId().equals(other.getShoppingCarId()))
            && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId()))
            && (this.getGoodsName() == null ? other.getGoodsName() == null : this.getGoodsName().equals(other.getGoodsName()))
            && (this.getGoodsNum() == null ? other.getGoodsNum() == null : this.getGoodsNum().equals(other.getGoodsNum()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getShoppingCarId() == null) ? 0 : getShoppingCarId().hashCode());
        result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
        result = prime * result + ((getGoodsName() == null) ? 0 : getGoodsName().hashCode());
        result = prime * result + ((getGoodsNum() == null) ? 0 : getGoodsNum().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", shoppingCarId=").append(shoppingCarId);
        sb.append(", goodsId=").append(goodsId);
        sb.append(", goodsName=").append(goodsName);
        sb.append(", goodsNum=").append(goodsNum);
        sb.append(", userId=").append(userId);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}